<style>
    .layui-form-label {
        width: 70px;
    }
</style>
<div class="layuimini-container">
    <div class="layuimini-main" id="app">
        <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
            <ul class="layui-tab-title">
                <li class="layui-this">第三方授权登录</li>
                <li>QQ登录配置</li>
                {if lsAuth()}
                <li>微信公众号配置</li>
                <li>微信登录(开放平台)配置</li>
                <li>支付宝登录配置</li>
                <li>钉钉登录配置</li>
                {/if}
            </ul>
            <div class="layui-tab-content">
                <div class="layui-tab-item layui-show">

                    <form class="layui-form layuimini-form">
                        <input type="hidden" name="field" value="applogin">
                        <div class="layui-form-item">
                            <label class="layui-form-label required">启用三方登录</label>
                            <div class="layui-input-block">
                                {if lsAuth()}
                                {foreach ['qq'=>'QQ登录','wechart'=>'微信公众号授权','weixin'=>'微信登录(开放平台)','alipay'=>'支付宝登录','dingtalk'=>'钉钉登录']  as $key=>$val}
                                <input type="checkbox" name="login_types[]" value="{$key}" title="{$val}" {if sysconfig('applogin.login_types') && @in_array($key,sysconfig('applogin.login_types'))}checked{/if}>
                               {/foreach}
                                {else/}
                                <input type="checkbox" name="login_types[]" value="qq" {if sysconfig('applogin.login_types') && @in_array('qq',sysconfig('applogin.login_types'))}checked{/if} title="QQ登录">
                               {/if}
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label">新用户绑定</label>
                            <div class="layui-input-block">
                                <?php $login_add_new=sysconfig('applogin.login_add_new'); ?>
                                <input type="radio" name="login_add_new" lay-filter="login_add_new" lay-verify="otherReq"  value="1" title="自动注册新用户名"  {if condition="$login_add_new eq 1" }checked{/if}>
                                <input type="radio" name="login_add_new" lay-filter="login_add_new" lay-verify="otherReq"  value="0" title="需重新注册"  {if condition="$login_add_new eq 0" }checked{/if}>
                            </div>
                        </div>
                        <div class="hr-line"></div>
                        <div class="submit-info text-center">
                            <button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit="system.config/save" data-refresh="false">确认</button>
                            <a class="layui-btn layui-btn-primary layui-btn-sm" layform-close>关闭</a>
                        </div>

                    </form>

                </div>
                <div class="layui-tab-item">
                    <form class="layui-form layuimini-form">
                        <input type="hidden" name="field" value="qq">
                        <input type="hidden" name="scope" value="get_user_info">
                        <div class="layui-form-item layui-row">
                            <div class="layui-col-md3">
                                <label class="layui-form-label">APP ID</label>
                                <div class="layui-input-block">
                                    <input type="text" name="app_id" value="{:sysconfig('qq','app_id')}"
                                           required lay-verify="required" autocomplete="off"
                                           class="layui-input">
                                </div>
                            </div>
                            <div class="layui-col-md4">
                                <label class="layui-form-label">APP Key</label>
                                <div class="layui-input-block">
                                    <input type="text" name="app_secret" value="{:sysconfig('qq','app_secret')}"
                                           required lay-verify="required" autocomplete="off"
                                           class="layui-input">
                                </div>
                            </div>
                            <div class="layui-col-md5">
                                <label class="layui-form-label">回调地址</label>
                                <div class="layui-input-block">
                                    <input type="text"  value="<?php echo DOMAIN_URL.'/callback/qq.html';?>"  autocomplete="off" class="layui-input">
                                </div>
                            </div>
                        </div>

                        <div class="hr-line"></div>
                        <div class="submit-info text-center">
                            <button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit="system.config/save" data-refresh="false">确认</button>
                            <a class="layui-btn layui-btn-primary layui-btn-sm" layform-close>关闭</a>
                        </div>

                    </form>

                </div>
                {if lsAuth()}
                <div class="layui-tab-item">
                    <form class="layui-form layuimini-form">
                        <input type="hidden" name="field" value="wechart">

                        <div class="layui-form-item">
                            <label class="layui-form-label required">APP ID</label>
                            <div class="layui-input-block">
                                <input type="text" name="app_id" class="layui-input" lay-verify="required" lay-reqtext="请输入公钥信息" placeholder="请输入公钥信息" value="{:sysconfig('wechart','app_id')}">
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label required">APP Secret</label>
                            <div class="layui-input-block">
                                <input type="text" name="app_secret" class="layui-input" lay-verify="required" lay-reqtext="请输入私钥信息" placeholder="请输入私钥信息" value="{:sysconfig('wechart','app_secret')}">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label required">验证方式</label>
                            <div class="layui-input-block">
                                <input type="radio" name="scope"  value="snsapi_base" title="静默授权" {if 'snsapi_base'==sysconfig('wechart','scope')}checked{/if}>
                                <input type="radio" name="scope"  value="snsapi_userinfo" title="获取用户信息" {if 'snsapi_userinfo'==sysconfig('wechart','scope')}checked{/if}>
                                <div class="label-tint">静默授权方式不能获取昵称</div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">回调地址</label>
                            <div class="layui-input-block">
                                <input type="text"  value="<?php echo DOMAIN_URL.'/callback/wechart.html';?>"  autocomplete="off" class="layui-input">
                            </div>
                        </div>



                        <div class="hr-line"></div>
                        <div class="submit-info text-center">
                            <button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit="system.config/save" data-refresh="false">确认</button>
                            <a class="layui-btn layui-btn-primary layui-btn-sm" layform-close>关闭</a>
                        </div>

                    </form>

                </div>
                <div class="layui-tab-item">
                    <form class="layui-form layuimini-form">
                        <input type="hidden" name="field" value="weixin">

                        <div class="layui-form-item">
                            <label class="layui-form-label required">APP ID</label>
                            <div class="layui-input-block">
                                <input type="text" name="app_id" class="layui-input" lay-verify="required" lay-reqtext="请输入公钥信息" placeholder="请输入公钥信息" value="{:sysconfig('weixin','app_id')}">
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label required">APP Secret</label>
                            <div class="layui-input-block">
                                <input type="text" name="app_secret" class="layui-input" lay-verify="required" lay-reqtext="请输入私钥信息" placeholder="请输入私钥信息" value="{:sysconfig('weixin','app_secret')}">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label required">验证方式</label>
                            <div class="layui-input-block">
                                <input type="radio" name="scope"  value="snsapi_login" title="扫码登录" checked>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">回调地址</label>
                            <div class="layui-input-block">
                                <input type="text"  value="<?php echo DOMAIN_URL.'/callback/weixin.html';?>"  autocomplete="off" class="layui-input">
                            </div>
                        </div>



                        <div class="hr-line"></div>
                        <div class="submit-info text-center">
                            <button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit="system.config/save" data-refresh="false">确认</button>
                            <a class="layui-btn layui-btn-primary layui-btn-sm" layform-close>关闭</a>
                        </div>

                    </form>

                </div>

                <div class="layui-tab-item">
                    <form  class="layui-form layuimini-form">

                        <input type="hidden" name="field" value="alipay">
                        <input type="hidden" name="scope" value="auth_user">
                        <div class="layui-form-item">
                            <label class="layui-form-label required">AppID</label>
                            <div class="layui-input-block">
                                <input type="text" name="app_id" class="layui-input" lay-verify="required" lay-reqtext="请输入公钥信息" placeholder="请输入公钥信息" value="{:sysconfig('alipay','app_id')}">
                                <tip>例子：1400483999</tip>
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label  class="layui-form-label">应用私钥</label>
                            <div class="layui-input-block">
                                <textarea name="pem_private"  class="layui-textarea">{:sysconfig('alipay.pem_private')}</textarea>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">回调地址</label>
                            <div class="layui-input-block">
                                <input type="text"  value="<?php echo DOMAIN_URL.'/callback/alipay.html';?>"  autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="hr-line"></div>
                        <div class="submit-info text-center">
                            <button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit="system.config/save" data-refresh="false">确认</button>
                            <a class="layui-btn layui-btn-primary layui-btn-sm" layform-close>关闭</a>
                        </div>

                    </form>
                </div>

                <div class="layui-tab-item">
                    <form  class="layui-form layuimini-form">

                        <input type="hidden" name="field" value="dingtalk">
                        <input type="hidden" name="scope" value="snsapi_login">


                        <div class="layui-form-item">
                            <label  class="layui-form-label">AppId</label>
                            <div class="layui-input-block">
                                <input type="text" name="app_id" class="layui-input" lay-verify="required" lay-reqtext="请输入" placeholder="" value="{:sysconfig('dingtalk','app_id')}">
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label  class="layui-form-label">AppSecret</label>
                            <div class="layui-input-block">
                                <input type="text" name="app_secret" class="layui-input" lay-verify="required" lay-reqtext="请输入" placeholder="" value="{:sysconfig('dingtalk','app_secret')}">
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label">回调地址</label>
                            <div class="layui-input-block">
                                <input type="text"  value="<?php echo DOMAIN_URL.'/callback/dingtalk.html';?>"  autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="hr-line"></div>
                        <div class="submit-info text-center">
                            <button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit="system.config/save" data-refresh="false">确认</button>
                            <a class="layui-btn layui-btn-primary layui-btn-sm" layform-close>关闭</a>
                        </div>

                    </form>
                </div>
                {/if}
            </div>
        </div>

    </div>
</div>